import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { TabsPage } from '../tabs/tabs';
import {App } from 'ionic-angular'; 

//import { BaHttp } from '../../theme/baHttp/baHttp.service';
@Component({
  selector: 'page-login',
  templateUrl: 'login.html'
})
export class LoginPage {

  constructor(public navCtrl: NavController,
  private app: App,
  //private _http: BaHttp
  ) {
   
  }
  logIn(username: HTMLInputElement, password: HTMLInputElement) {
    // if (username.value.length == 0) {
    //   alert("请输入账号");
    // } 
    // else if (password.value.length == 0) {
    //   alert("请输入密码");
    // }
    // else {
    //   this._http.post('http://localhost:31173/login', { username: username.value, password: password.value }, (res) => {
    //     if (res.info === 'success') {
          this.app.getRootNav().setRoot(TabsPage);
      //   }
      //   else {
      //     alert(res.info);
      //   }
      // });
    // }
}

}
